package edu.scsw.tech.unit2;

import java.util.Scanner;

public class ArithmeticOperations {
    public static void main(String[] args) {
        // 创建一个Scanner对象来读取用户输入
        Scanner scanner = new Scanner(System.in);

        // 提示用户输入第一个整数
        System.out.print("请输入第一个整数: ");
        int num1 = scanner.nextInt();

        // 提示用户输入第二个整数
        System.out.print("请输入第二个整数: ");
        int num2 = scanner.nextInt();

        // 计算和、差、积和商
        int sum = num1 + num2;
        int difference = num1 - num2;
        int product = num1 * num2;
        int quotient = num1 / num2;
        // 取余
        int remainder = num1 % num2;

        // 输出结果
        System.out.println("两个数的和是: " + sum);
        System.out.println("两个数的差是: " + difference);
        System.out.println("两个数的积是: " + product);
        System.out.println("两个数的商是: " + quotient);
        System.out.println("两个数的余数是: " + remainder);

        String str = "Hello, ";
        System.out.print("请输入一个字符串: ");
        String str1 = scanner.next();
        System.out.println(str + str1);
    }
}

